package org.common.utils.net.netty.bytes.entity;

import java.util.Arrays;

/**
 * 默认的Byte消息实体
 * @author zhouzhibing
 * @date 2025/11/14 22:06
 */
public class DefaultByteMessage {
    /**
     * 消息类型
     */
    private byte type;
    /**
     * 序列号
     */
    private long serialNo;
    /**
     *  消息ID
     */
    private long messageId;
    /**
     *  数据内容
     */
    private byte[] data;

    public DefaultByteMessage(byte type , long serialNo, long messageId, byte[] data) {
        this.type = type;
        this.serialNo = serialNo;
        this.messageId = messageId;
        this.data = data;
    }

    public byte getType() {
        return type;
    }

    public long getSerialNo() {
        return serialNo;
    }

    public long getMessageId() {
        return messageId;
    }

    public byte[] getData() {
        return data;
    }

    @Override
    public String toString() {
        return "NettyMessage{" +
                "type=" + type +
                ", serialNo=" + serialNo +
                ", messageId=" + messageId +
                ", data=" + Arrays.toString(data) +
                '}';
    }
}
